home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / database / lbhr20_a.zip / POSTSCRI.DLD < prev    next >
Text File  |  1994-08-13  |  17KB  |  669 lines

  1. 
  2. %
  3. % ctrl-D to clear any hanging input
  4. %
  5. % dBASE IV Postscript Download File (Postscri.dld)
  6. % Copyright 1989,1991 Borland International, Inc.
  7. % version 1.13
  8. % $Revision:   1.3  $ 
  9. %
  10. % --------- User-adjustable parameters -------
  11. % default page size & orientation
  12. /paper 1 def      % (1=letter, 2=legal, 3=A4)
  13. /orient 1 def     % (1=portrait, 2=landscape)
  14. /nLPP 66 def      % lines per page (60, 66, 78, or 88 for portrait;
  15.                   %                 45 for landscape)
  16. % printer-dependent portrait offsets
  17. /tpxoff 18 def    % x (letter)
  18. /tpyoff 28 def    % y (letter)
  19. /gpxoff 22 def    % x (legal)
  20. /gpyoff 26 def    % y (legal)
  21. /apxoff 16 def    % x (A4)
  22. /apyoff 18 def    % y (A4)
  23. % printer-dependent landscape offsets
  24. /tlxoff 18 def    % x (letter)
  25. /tlyoff 44 def    % y (letter)
  26. /glxoff 18 def    % x (legal)
  27. /glyoff 80 def    % y (legal)
  28. /alxoff  0 def    % x (A4)
  29. /alyoff 29 def    % y (A4)
  30. % point sizes to use
  31. /PicaPoint 12 def                            % Pica
  32. /ElitePoint 10 def                           % Elite
  33. /CompressedPoint 8 def                       % compressed
  34. /CurPoint PicaPoint def                      % initial pointsize
  35. % fonts to use
  36. /CurFSet 1 def                               % default font set
  37. /FSet {
  38.          /CurFSet exch def
  39.          % Font Set 1 (default)
  40.          /n       /Courier-Foreign def                        % normal
  41.          /b       /Courier-Bold-Foreign def                   % bold
  42.          /i       /Courier-Oblique-Foreign def                % italic
  43.          /bi      /Courier-BoldOblique-Foreign def            % bold+italic
  44.          CurFSet 2 eq
  45.                   {
  46.                   /n       /Helvetica-Foreign def
  47.                   /b       /Helvetica-Bold-Foreign def
  48.                   /i       /Helvetica-Oblique-Foreign def
  49.                   /bi      /Helvetica-BoldOblique-Foreign def
  50.                   } if
  51.          CurFSet 3 eq
  52.                   {
  53.                   /n       /Times-Roman-Foreign def
  54.                   /b       /Times-Bold-Foreign def
  55.                   /i       /Times-Italic-Foreign def
  56.                   /bi      /Times-BoldItalic-Foreign def
  57.                   } if
  58.          /FontNorm n def
  59.          /FontBold b def
  60.          /FontItal i def
  61.          /FontBoldItal bi def
  62.          Norm
  63.    } def
  64. % --------- End User-adjustable parameters -------
  65. % ------ User-callable macros
  66. /Letter  {/paper 1 def OrientPaper} def      % Set Letter
  67. /Legal   {/paper 2 def OrientPaper} def      % Set Legal
  68. /A4      {/paper 3 def OrientPaper} def      % Set A4
  69. /Port    {/orient 1 def OrientPaper} def     % Set Portrait
  70. /Land    {/orient 2 def OrientPaper} def     % Set Landscape
  71. /60LPP   {60 LPP} def
  72. /66LPP   {66 LPP} def
  73. /78LPP   {78 LPP} def
  74. /88LPP   {88 LPP} def
  75. /1Font   {1 FSet} def
  76. /2Font   {2 FSet} def
  77. /3Font   {3 FSet} def
  78. % Synonyms
  79. /LETTER  {Letter} def
  80. /LEGAL   {Legal} def 
  81. /PORT    {Port} def /port {Port} def
  82. /LAND    {Land} def /land {Land} def
  83. /60lpp {60LPP} def
  84. /66lpp {66LPP} def
  85. /78lpp {78LPP} def
  86. /88lpp {88LPP} def
  87. /1FONT {1Font} def /1font {1Font} def
  88. /2FONT {2Font} def /2font {2Font} def
  89. /3FONT {3Font} def /3font {3Font} def
  90. % ------ End
  91. %
  92. % Page Setup
  93. /PSet {
  94.          initmatrix
  95.          CurFSet FSet
  96.          /CPI 10 def
  97.          /LPI 6 def
  98.          /HMI 72 def
  99.          /VMI 72 def
  100.          paper 1 eq
  101.                   {orient 1 eq      % letter
  102.                            {/w 8.5 def /h 10.0 def             % letter port
  103.                            nLPP 60 eq {/h 10.0 def} if
  104.                            nLPP 66 eq {/h 10.1 def /LPI 6.6 def} if
  105.                            nLPP 78 eq {/h 13.0 def} if
  106.                            }
  107.                            {/w 11.0 def /h 7.5 def             % letter land
  108.                            /nLPP 45 def
  109.                            } ifelse
  110.                   } if
  111.          paper 2 eq
  112.                   {orient 1 eq      % legal
  113.                            {/w 8.5 def /h 13.1 def             % legal port
  114.                            /nLPP 78 def
  115.                            }
  116.                            {/w 14.0 def /h 6.5 def             % legal land
  117.                            /nLPP 45 def
  118.                            } ifelse
  119.                   } if
  120.          paper 3 eq
  121.                   {orient 1 eq      % A4
  122.                            {/w 8.5 def /h 11 def               % A4 port
  123.                /LPI 6.05 def               % makes labels work
  124.                            nLPP 88 eq {/LPI 8 def} if
  125.                            }
  126.                            {/w 11 def /h 7.5 def               % A4 land
  127.                            /nLPP 45 def
  128.                            } ifelse
  129.                   } if
  130.          /PageWidth w def
  131.          /PageHeight h def
  132.    } def
  133.  
  134. % initialize variables
  135. /BaseLine 0 def
  136. /Bon 0 def
  137. /Ion 0 def
  138. /LocalBox 0 def
  139. %----
  140. %
  141. % Define new BaseLine value
  142. /DefBase {        % args = (new baseline)
  143.    /BaseLine exch def
  144.    } def
  145. %
  146. % Move to a new line
  147. /GoNewLine {      % args = (x,y)
  148.    dup DefBase moveto
  149.    currentpoint exch pop 0 lt {FF} if
  150.    } def
  151. %
  152. % Rotate and/or Translate (if nec.)
  153. /RoTran {
  154.          orient 1 eq
  155.                   {paper 1 eq                                  % PORTRAIT
  156.                            {tpxoff tpyoff translate}           % Letter
  157.                            {paper 2 eq
  158.                                     {gpxoff gpyoff translate}  % Legal
  159.                                     {apxoff apyoff translate}  % A4
  160.                            ifelse
  161.                            } 
  162.                   ifelse
  163.                   }
  164.                   {-90 rotate                                  % LANDSCAPE
  165.                   paper 1 eq
  166.                            {11.0}                              % Letter
  167.                            {paper 2 eq
  168.                                     {14.0}                     % Legal
  169.                                     {11.5}                     % A4
  170.                            ifelse
  171.                            }
  172.                   ifelse
  173.                   VMI mul neg 0 translate
  174.                   
  175.                   paper 1 eq
  176.                            {tlxoff tlyoff translate}           % Letter
  177.                            {paper 2 eq
  178.                                     {glxoff glyoff translate}  % Legal
  179.                                     {alxoff alyoff translate}  % A4
  180.                                     ifelse
  181.                                     }
  182.                            ifelse
  183.  
  184.                   /LPI 6 def}
  185.                   ifelse
  186.          } def
  187. %
  188. %        Move to top left corner of new page
  189. /Home {
  190.    RoTran
  191.    clear
  192.    0
  193.    PageHeight VMI mul
  194.       GoNewLine CRLF
  195.    } def
  196. %
  197. % Set nLPP
  198. /LPP {   % arg = (#lines per page)
  199.    /nLPP exch def
  200.    PSet
  201.    Home
  202.    } def
  203. % Chg Orientation or Paper
  204. %
  205. /OrientPaper {
  206.          PSet
  207.          Home
  208.          } def
  209. %
  210. %        Initialization
  211. /Init {
  212.    1.415 setmiterlimit
  213.    Home
  214.    Norm
  215.    } def
  216. %
  217. % FormFeed
  218. /FF {
  219.    showpage
  220.    Home
  221.    } def
  222. %
  223. % Carriage Return w/o LF
  224. /CR {
  225.    currentpoint
  226.    exch  pop
  227.    0
  228.    exch moveto
  229.    } def
  230. %
  231. % Carriage Return w/ Line Feed
  232. /CRLF {
  233.    CR currentpoint
  234.    VMI LPI div
  235.    sub
  236.    paper 3 ne { round } if     %% forces a4 7x2's to line up correctly
  237.    GoNewLine
  238.    } def
  239. %
  240. % Backspace
  241. /BS {
  242.    currentpoint
  243.    exch                    % bring x-pos to top
  244.    ( ) stringwidth         % get current font x,y size
  245.    pop                     % get rid of y-size
  246.    sub                     % backup 1 char's worth
  247.    exch moveto
  248.    } def
  249. %
  250. % Establish a different font
  251. /NewFont {
  252.    CurFont findfont
  253.    CurPoint scalefont
  254.    setfont
  255.    } def
  256. %
  257. % Start compressed (15 cpi) print
  258. /Cmp+ {/CurPoint CompressedPoint def NewFont} def
  259. %
  260. % End compressed print
  261. /Cmp- {/CurPoint PicaPoint def NewFont} def
  262. %
  263. % Start Pica pitch
  264. /10Cpi {/CurPoint PicaPoint def NewFont} def
  265. %
  266. % Start Elite pitch
  267. /12Cpi {/CurPoint ElitePoint def NewFont} def
  268. %
  269. % Change to a different font (same size): aFont ChgFont
  270. /ChgFont {
  271.    /CurFont exch def
  272.    CurFont findfont
  273.    CurPoint scalefont
  274.    setfont
  275.    } def
  276. %
  277. % Select un-attributed text
  278. /Norm {
  279.    FontNorm ChgFont
  280.    /Bon 0 def
  281.    /Ion 0 def
  282.    } def
  283. %
  284. % Select bolded text
  285. /Bold {
  286.    Ion 0 eq
  287.       {FontBold ChgFont}
  288.       {FontBoldItal ChgFont}
  289.       ifelse
  290.    /Bon 1 def
  291.    } def
  292. %
  293. % Select un-Bolded text
  294. /BNorm {
  295.    Ion 0 eq
  296.       {FontNorm ChgFont}
  297.       {FontItal ChgFont}
  298.       ifelse
  299.    /Bon 0 def
  300.    } def
  301. %
  302. % Select italicized text
  303. /Ital {
  304.    Bon 0 eq
  305.       {FontItal ChgFont}
  306.       {FontBoldItal ChgFont}
  307.       ifelse
  308.    /Ion 1 def
  309.    } def
  310. %
  311. % Select un-Italicized text
  312. /INorm {
  313.    Bon 0 eq
  314.       {FontNorm ChgFont}
  315.       {FontBold ChgFont}
  316.       ifelse
  317.    /Ion 0 def
  318.    } def
  319. %
  320. % Select bold+italicized text
  321. /BoIt {
  322.    FontBoldItal ChgFont
  323.    /Bon 1 def
  324.    /Ion 1 def
  325.    } def
  326. %
  327. % 1. calc a positive line movement of 1/2 the current point size
  328. % 2. move to the current baseline position
  329. /Script {
  330.    VMI CurPoint idiv 2 idiv
  331.    currentpoint pop BaseLine moveto
  332.    } def
  333. %
  334. % Start superscript
  335. /Sup+ {0 Script rmoveto} def
  336. %
  337. % End superscript
  338. /Sup- {Script pop} def
  339. %
  340. % Start subscript
  341. /Sub+ {0 Script neg rmoveto} def
  342. %
  343. % End subscript
  344. /Sub- {Script pop} def
  345. %
  346. % Start underlined text
  347. /Und+ {
  348.    currentpoint pop BaseLine        % estab start of underline position
  349.    2 sub                   % Y-pos = 2 points down from baseline
  350.    } def
  351. %
  352. % End underlined text
  353. /Und- {
  354.    currentpoint   % save current location
  355.    Und+ moveto    % move to ending underline position
  356.    4 2 roll                % bring starting underline position to top of stack
  357.    lineto                  % draw the line
  358.    stroke
  359.    moveto                  % return to original location
  360.    } def
  361. %
  362. % Overstrike 1st char w/ 2nd char
  363. /OV {             % string OV
  364.    /str 2 1 roll def
  365.    currentpoint
  366.    str 0 1 getinterval show
  367.    moveto
  368.    str 1 1 getinterval show
  369.    } def
  370. %
  371. % we are going to draw characters using current size
  372. % each point in movement is 1/72 of an inch
  373. % curpoint has the current character pitch selected
  374. % we'll use an oversized cell to contain all characters
  375. % to handle porportionally spaced font
  376. % Character height to be calculated from current lpi setting
  377. % character width to be calculated from current pitch setting
  378. %
  379. % Horizontal Line CHR(196) for single, CHR(205) for double
  380. /A {
  381.     /MLineHeight 72 LPI div 2 div def
  382.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  383.     /MLineWidth ( ) stringwidth pop 2 div def
  384.     show
  385.     currentpoint
  386.     0 MLineHeight rmoveto
  387.     MLineWidth 2 mul 0 rlineto
  388.     stroke
  389.     moveto
  390.     MLineWidth 2 mul 0 rmoveto
  391.    } def
  392. %
  393. /B {
  394.     /MLineHeight 72 LPI div 2 div def
  395.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  396.     /MLineWidth ( ) stringwidth pop 2 div def
  397.     show
  398.     currentpoint
  399.     0 MLineHeight 1 sub rmoveto
  400.     MLineWidth 2 mul 0 rlineto
  401.     stroke
  402.     moveto
  403.     currentpoint
  404.     0 MLineHeight 1 add rmoveto
  405.     MLineWidth 2 mul 0 rlineto
  406.     stroke
  407.     moveto
  408.     MLineWidth 2 mul 0 rmoveto
  409.    } def
  410. %
  411. % Vertical Line CHR(179) for single, CHR(186) for double
  412. /C {
  413.     /MLineHeight 72 LPI div 2 div def
  414.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  415.     /MLineWidth ( ) stringwidth pop 2 div def
  416.     show
  417.     currentpoint
  418.     MLineWidth 0 rmoveto
  419.     0 MLineHeight 2 mul rlineto
  420.     stroke
  421.     moveto
  422.     MLineWidth 2 mul 0 rmoveto
  423.    } def
  424. %
  425. /D {
  426.     /MLineHeight 72 LPI div 2 div def
  427.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  428.     /MLineWidth ( ) stringwidth pop 2 div def
  429.     show
  430.     currentpoint
  431.     MLineWidth 1 sub 0 rmoveto
  432.     0 MLineHeight 2 mul rlineto
  433.     stroke
  434.     moveto
  435.     currentpoint
  436.     MLineWidth 1 add 0 rmoveto
  437.     0 MLineHeight 2 mul rlineto
  438.     stroke
  439.     moveto
  440.     MLineWidth 2 mul 0 rmoveto
  441.    } def
  442. %
  443. % Top Left Corner    CHR(218) for single, CHR(201) for double
  444. /E {
  445.     /MLineHeight 72 LPI div 2 div def
  446.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  447.     /MLineWidth ( ) stringwidth pop 2 div def
  448.     show
  449.     currentpoint
  450.     MLineWidth 0 rmoveto
  451.     0 MLineHeight rlineto
  452.     MLineWidth 0 rlineto
  453.     stroke
  454.     moveto
  455.     MLineWidth 2 mul 0 rmoveto
  456.    } def
  457. %
  458. /F {
  459.     /MLineHeight 72 LPI div 2 div def
  460.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  461.     /MLineWidth ( ) stringwidth pop 2 div def
  462.     show
  463.     currentpoint
  464.     MLineWidth 1 sub 0 rmoveto
  465.     0 MLineHeight 1 add rlineto
  466.     MLineWidth 1 add 0 rlineto
  467.     stroke
  468.     moveto
  469.     currentpoint
  470.     MLineWidth 1 add 0 rmoveto
  471.     0 MLineHeight 1 sub  rlineto
  472.     MLineWidth 1 sub 0 rlineto
  473.     stroke
  474.     moveto
  475.     MLineWidth 2 mul 0 rmoveto
  476.    } def
  477. %
  478. % Bottom Left Corner    CHR(192) for single, CHR(200) for double
  479. /G {
  480.     /MLineHeight 72 LPI div 2 div def
  481.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  482.     /MLineWidth ( ) stringwidth pop 2 div def
  483.     show
  484.     currentpoint
  485.     MLineWidth MLineHeight 2 mul rmoveto
  486.     0 0 MLineHeight sub rlineto
  487.     MLineWidth 0 rlineto
  488.     stroke
  489.     moveto
  490.     MLineWidth 2 mul 0 rmoveto
  491.    } def
  492. %
  493. /H {
  494.     /MLineHeight 72 LPI div 2 div def
  495.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  496.     /MLineWidth ( ) stringwidth pop 2 div def
  497.     show
  498.     currentpoint
  499.     MLineWidth 1 sub MLineHeight 2 mul rmoveto
  500.     0 0 MLineHeight 1 add sub rlineto
  501.     MLineWidth 1 add 0 rlineto
  502.     stroke
  503.     moveto
  504.     currentpoint
  505.     MLineWidth 1 add MLineHeight 2 mul rmoveto
  506.     0 0 MLineHeight 1 sub sub  rlineto
  507.     MLineWidth 1 sub 0 rlineto
  508.     stroke
  509.     moveto
  510.     MLineWidth 2 mul 0 rmoveto
  511.    } def
  512. %
  513. % Top Right Corner    CHR(191) for single, CHR(187) for double
  514. /I {
  515.     /MLineHeight 72 LPI div 2 div def
  516.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  517.     /MLineWidth ( ) stringwidth pop 2 div def
  518.     show
  519.     currentpoint
  520.     0 MLineHeight rmoveto
  521.     MLineWidth 0 rlineto
  522.     0 0 MLineHeight sub rlineto
  523.     stroke
  524.     moveto
  525.     MLineWidth 2 mul 0 rmoveto
  526.    } def
  527. %
  528. /J {
  529.     /MLineHeight 72 LPI div 2 div def
  530.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  531.     /MLineWidth ( ) stringwidth pop 2 div def
  532.     show
  533.     currentpoint
  534.     0 MLineHeight 1 add rmoveto
  535.     MLineWidth 1 add 0 rlineto
  536.     0 0 MLineHeight 1 add sub rlineto
  537.     stroke
  538.     moveto
  539.     currentpoint
  540.     0 MLineHeight 1 sub rmoveto
  541.     MLineWidth 1 sub 0 rlineto
  542.     0 0 MLineHeight 1 sub sub rlineto
  543.     stroke
  544.     moveto
  545.     MLineWidth 2 mul 0 rmoveto
  546.    } def
  547. %
  548. % Bottom Right Corner    CHR(217) for single, CHR(188) for double
  549. /K {
  550.     /MLineHeight 72 LPI div 2 div def
  551.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  552.     /MLineWidth ( ) stringwidth pop 2 div def
  553.     show
  554.     currentpoint
  555.     0 MLineHeight rmoveto
  556.     MLineWidth 0 rlineto
  557.     0 MLineHeight rlineto
  558.     stroke
  559.     moveto
  560.     MLineWidth 2 mul 0 rmoveto
  561.    } def
  562. %
  563. /L {
  564.     /MLineHeight 72 LPI div 2 div def
  565.     /MLineWidth 72 CurPoint div 5 mul 8 div def
  566.     /MLineWidth ( ) stringwidth pop 2 div def
  567.     show
  568.     currentpoint
  569.     0 MLineHeight 1 sub rmoveto
  570.     MLineWidth 1 add 0 rlineto
  571.     0 MLineHeight 1 add rlineto
  572.     stroke
  573.     moveto
  574.     currentpoint
  575.     0 MLineHeight 1 add  rmoveto
  576.     MLineWidth 1 sub 0 rlineto
  577.     0 MLineHeight 1 sub rlineto
  578.     stroke
  579.     moveto
  580.     MLineWidth 2 mul 0 rmoveto
  581.    } def
  582. %
  583. /reencodedict 36 dict def
  584. /ReEncode
  585.   {reencodedict begin
  586.    /newfontname exch def
  587.    /basefontname exch def
  588.    /basefontdict basefontname findfont def
  589.    /newfont basefontdict maxlength dict def
  590.    basefontdict
  591.      {exch dup /FID ne
  592.        {dup /Encoding eq
  593.          {exch dup length array copy
  594.             newfont 3 1 roll put}
  595.          {exch newfont 3 1 roll put}
  596.          ifelse}
  597.        {pop pop}
  598.        ifelse
  599.      } forall
  600.    newfont /FontName newfontname put
  601.    foreignvec aload pop
  602.    foreignvec length 2 idiv
  603.    {newfont /Encoding get 3 1 roll put}
  604.    repeat
  605.    newfontname newfont definefont pop
  606.    end 
  607.   } def
  608. /foreignvec [
  609. 128 /Ccedilla
  610. 129 /udieresis
  611. 130 /eacute
  612. 131 /acircumflex
  613. 132 /adieresis
  614. 133 /agrave
  615. 134 /aring
  616. 135 /ccedilla
  617. 136 /ecircumflex
  618. 137 /edieresis
  619. 138 /egrave
  620. 139 /idieresis
  621. 140 /icircumflex
  622. 141 /igrave
  623. 142 /Adieresis
  624. 143 /Aring
  625. 144 /Eacute
  626. 145 /ae
  627. 146 /AE
  628. 147 /ocircumflex
  629. 148 /odieresis
  630. 149 /ograve
  631. 150 /ucircumflex
  632. 151 /ugrave
  633. 152 /ydieresis
  634. 153 /Odieresis
  635. 154 /Udieresis
  636. 155 /cent
  637. 156 /sterling
  638. 157 /yen
  639. 159 /florin
  640. 160 /aacute
  641. 161 /iacute                      
  642. 162 /oacute
  643. 163 /uacute
  644. 164 /ntilde
  645. 165 /Ntilde
  646. 166 /ordfeminine
  647. 167 /ordmasculine
  648. 168 /questiondown
  649. 173 /exclamdown
  650. 174 /guillemotleft
  651. 175 /guillemotright
  652. 225 /germandbls
  653. 249 /bullet
  654. ] def
  655. /Courier /Courier-Foreign ReEncode
  656. /Courier-Bold /Courier-Bold-Foreign ReEncode
  657. /Courier-Oblique /Courier-Oblique-Foreign ReEncode
  658. /Courier-BoldOblique /Courier-BoldOblique-Foreign ReEncode
  659. /Helvetica /Helvetica-Foreign ReEncode
  660. /Helvetica-Bold /Helvetica-Bold-Foreign ReEncode
  661. /Helvetica-Oblique /Helvetica-Oblique-Foreign ReEncode
  662. /Helvetica-BoldOblique /Helvetica-BoldOblique-Foreign ReEncode
  663. /Times-Roman /Times-Roman-Foreign ReEncode
  664. /Times-Bold /Times-Bold-Foreign ReEncode
  665. /Times-Italic /Times-Italic-Foreign ReEncode
  666. /Times-BoldItalic /Times-BoldItalic-Foreign ReEncode
  667. PSet
  668. %----- end of Postscri.dld ----
  669.